// pages/help/help.js
const app = getApp(), core = require('../../utils/core');
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    core.get({url:'xilujob.user/help_list',success:ret=>{
      this.setData({helps: ret.data});
    }});
  },

  detail(e){
    let id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '/pages/helpdetail/helpdetail?id='+id,
    })
  },

  toggle(event) {
    let index = event.currentTarget.dataset.index;
    this.setData({['helps['+index+'].show']: !this.data.helps[index].show});
  }

});
